import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'


//路由懒加载
const about = () =>
    import ('./views/About.vue')
const users = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/users.vue')
const roles = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/roles.vue')
const rights = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/rights.vue')
const goods = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/goods.vue')
const params = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/params.vue')

const categories = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/categories.vue')
const orders = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/orders.vue')
const reports = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/reports.vue')
const page = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/page.vue')
const add = () =>
    import ( /* webpackChunkName: "Welcome" */ './views/add.vue')



Vue.use(Router)

export default new Router({
    routes: [{
            path: '/',
            name: 'home',
            component: Home,
        },
        {
            path: '/about',
            name: 'about',
            component: about,
            redirect: '/page',
            children: [{
                    path: '/users',
                    name: 'users',
                    component: users
                },
                {
                    path: '/roles',
                    name: 'roles',
                    component: roles
                },
                {
                    path: '/rights',
                    name: 'rights',
                    component: rights
                },
                {
                    path: '/goods',
                    name: 'goods',
                    component: goods
                },
                {
                    path: '/params',
                    name: 'params',
                    component: params
                },
                {
                    path: '/categories',
                    name: 'categories',
                    component: categories
                }, {
                    path: '/orders',
                    name: 'orders',
                    component: orders
                },
                {
                    path: '/reports',
                    name: 'reports',
                    component: reports
                },
                {
                    path: '/page',
                    name: 'page',
                    component: page
                },
                {
                    path: '/add',
                    name: 'add',
                    component: add
                },

            ]

        },


    ]
})